string function FileName

The string function FileName strips the leading directory names of the filename given as an argument. Note that the command: basename File Extension is equivalent to the command: FileName(File) - Extension so that filename constructions can be made in foreach loop for example.

FileName(String)

     foreach File in ls /usr/machin/data/*.32
         read $File X:1 Y:2{2:23}
         # Some commands
         .
         .
         # let File be the filename only, less the ".32" extension
         let File = FileName(File) - ".32"
         # And let Dir be the directory name
         let Dir = DirName(File)
     end

foreach, string functions, cmode, $